package com.bcbim.authentication.ability.mapper;

import com.bcbim.authentication_interface.ability.dao.RoleAbilityDAO;
import com.bcbim.authentication_interface.ability.dto.AbilityDTO;
import com.bcbim.authentication_interface.ability.vo.AbilityDetailVO;
import com.bcbim.common.sys.Code;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @program: working_platform
 * @Description:
 * @Author xuehao
 * @Date 2022/02/09  15:08
 * @Version V1.0
 **/
@Mapper
public interface AbilityMaintainMapper {
    /**
     * 二级菜单下拉
     *
     * @param parentId
     * @author xuehao
     * @createDate 2022/2/9 15:11
     * @retuen List<Code>
     */
    List<Code> pullSubMenu(@Param("parentId") String parentId, @Param("applicationPlatform") String applicationPlatform);

    /**
     * 一级菜单下拉
     *
     * @author xuehao
     * @createDate 2022/2/10 10:28
     * @retuen List<Code>
     */
    List<Code> pullParentMenu(String applicationPlatform);

    /**
     * 新增功能
     *
     * @param abilityDTO
     * @author xuehao
     * @createDate 2022/2/10 16:22
     * @retuen int
     */
    int insertAbility(AbilityDTO abilityDTO);

    /**
     * 删除功能
     *
     * @param id
     * @author xuehao
     * @createDate 2022/2/10 17:01
     * @retuen int
     */
    int deleteAbility(String id);

    /**
     * 通过用户查角色id
     *
     * @param userId
     * @author xuehao
     * @createDate 2022/2/11 14:09
     * @retuen String
     */
    String getRoleIdByUser(String userId);

    /**
     * 新增角色功能
     *
     * @param roleAbilityDAO
     * @author xuehao
     * @createDate 2022/2/11 14:17
     * @retuen int
     */
    void insertRoleAbility(RoleAbilityDAO roleAbilityDAO);

    /**
     * 查询功能详情
     *
     * @param abilityId
     * @author xuehao
     * @createDate 2022/2/11 15:07
     * @retuen AbilityDetailVO
     */
    AbilityDetailVO getAbilityDetail(String abilityId);

    /**
     * 编辑功能
     *
     * @param abilityDTO
     * @author xuehao
     * @createDate 2022/2/11 16:45
     * @retuen int
     */
    int updateAbility(AbilityDTO abilityDTO);

    /**
     * 根据二级菜单查一级菜单id
     *
     * @param menuId
     * @author xuehao
     * @createDate 2022/2/11 18:00
     * @retuen String
     */
    String getParentMenuId(String menuId);
}
